<extend name="template/base_index" />


<block name="area_header">
<script type="text/javascript" src="__CDN__/jquery-validation/1.13.1/jquery.validate.min.js"></script>
	<script type="text/javascript" src="__CDN__/jquery-validation/1.13.1/localization/messages_zh.min.js"></script>
	<link rel="stylesheet" type="text/css" href="__CDN__/comp/wxuploader.css" />
	<link type="text/css" rel="stylesheet" href="__CDN__/jquery-uploadify/3.2.1/uploadify.css" />
	<script type="text/javascript" src="__CDN__/jquery-uploadify/3.2.1/jquery.uploadify.min.js"></script>
	

</block>

<block name="area_body">
	{:W('Menus/topbar')}
	<div class="admin-main container-fluid">
		{:W('Menus/left')}
		<div class="admin-main-content">
			{:W('Menus/breadcrumb')}
		
			<!-- 带验证 form -->
			<form class="form-horizontal well validateForm">
				<input type="hidden" name="parent" value="{$parent}" />
				<input type="hidden" name="id" value="{$vo.id}" />
				<fieldset>
					<legend>
						数据字典－添加</legend>
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">名称</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short" value="{$vo.name}" name="name" id="inputtitle" placeholder="请输入名称不要超过30个字">
							<div class="help-block">(请输入名称不要超过30个字)</div>
						</div>
					</div>
					<div class="form-group">
						<label for="code" class="col-md-2 col-lg-2 control-label">代码</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="form-control input-short" name="code" id="code" value="{$vo.code}" placeholder="请输入代码">
							<div class="help-block"></div>
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">图标<br/>（选填）</label>
						<div class="col-md-10 col-lg-10">
							<input type="hidden" class="required form-control input-short" id="iconurl" name="iconurl"  >
							
							<!-- 图片选择DOM结构 -->
							<div class="wxuploaderimg clearfix banner  <notempty name="vo.iconurl">checked</notempty>" data-maxitems="1">
								<div class="img-preview clearfix" >
									<notempty name="vo.iconurl">
											<div class="pull-left clearfix img-item">
												<img src="{$vo.iconurl}" />
												<div class="edit_pic_wrp"><a href="javascript:;" class="fa fa-lg fa-trash js_delete"></a></div>
											</div>
									</notempty>
								</div>
								<div class="add">
									<i class="fa fa-plus"></i>
								</div>
							</div>
							<!-- 图片选择DOM结构 -->
							
							<div class="help-block">(图标,可不填)</div>
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">排序</label>
						<div class="col-md-10 col-lg-10">
							<input type="text" class="required form-control input-short" value="{$vo.sort}" name="sort"  placeholder="">
							<div class="help-block">(请输入排序，从大到小排序)</div>
						</div>
					</div>
					
					<div class="form-group">
						<label for="inputtitle" class="col-md-2 col-lg-2 control-label">备注</label>
						<div class="col-md-10 col-lg-10">
							<textarea rows="3" name="notes" class="form-control">{$vo.notes}</textarea>
							<div class="help-block">(备注，选填)</div>
						</div>
					</div>
					
					<div class="form-group">
						<label for="btns" class="col-md-2 col-lg-2 control-label">&nbsp;</label>
						<div class="col-lg-10 col-md-10">
							<a target-form="validateForm" onclick="return getData();" class="ajax-post btn btn-primary" href="__SELF__" autofocus="autofocus"><i class="fa fa-save"></i> {:L('BTN_SAVE')}</a>
							<a class="btn btn-default" href="{:U('Admin/Datatree/index',array('parent'=>$parent))}"><i class="fa fa-times-circle"></i> {:L('BTN_CANCEL')}</a>
						</div>
					</div>
				</fieldset>
			</form>
			<!-- form -->
			<include file="template/wxpicture" />

		</div>
		<!-- END admin-main-content -->
	</div>
		<!-- END admin-main-->
</block>

<block name="area_footer">
<script type="text/javascript">
	function getData(){
		var img = $(".wxuploaderimg img").attr("src");
		$("#iconurl").val(img);
		
		return true;
	}
	
	$(function(){
			wxuploadimg.init({cont:".wxuploaderimg"});
	});
	</script>
</block>